class CreateProductAssets < ActiveRecord::Migration
  def change
    create_table :product_assets, :force => true do |t|
      t.references :viewable, :null => false
      t.string     :viewable_type, :limit => 50, :null => false
      t.string     :attachment_content_type, :null => false
      t.string     :attachment_file_name, :null => false
      t.integer    :attachment_file_size, :limit => 10
      t.datetime   :attachment_updated_at
      t.integer    :position, :limit => 4
      t.string     :type, :limit => 50
      t.string     :name, :limit => 100
      t.string     :description, :limit => 250
    end

    add_index :product_assets, :viewable_id
  end
end
